package com.zlf.blog.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Stack;


/**
 * @author zlfi1
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    @ApiModelProperty("是否成功")
    private boolean success;

    @ApiModelProperty("返回code")
    private Integer code;

    @ApiModelProperty("消息")
    private String msg;

    @ApiModelProperty("数据")
    private Object data;


    public static Result success(Object data) {
        return new Result(true,200,"success",data);
    }
    public static Result fail(Integer code, String msg) {
        return new Result(false,code,msg,null);
    }
    public static Result diy(Integer code,String msg,boolean success,Object data){
        return new Result(success,code,msg,data);
    }
}